//
//  PlatformTools.h
//  CedarSuperCloud
//
//  Created by lshenrong on 2017/11/24.
//  Copyright © 2017年 cedarhd. All rights reserved.
//

#import <Foundation/Foundation.h>


typedef void(^PushNotificationSetting)(BOOL isEnable);



@interface  YearMonth : NSObject

@property(nonatomic,assign) NSInteger year;
@property(nonatomic,assign) NSInteger month;
@property(nonatomic,copy) NSString *dateStr;

- (NSString *)timeFormateString;

@end


//平台相关工具
@interface PlatformTools : NSObject

+ (NSString *)appVersion;
+ (NSString *)deviceModel;
+ (NSString *)deviceUDID;
+ (NSString *)deviceGUID;
+ (NSString *)deviceIPAdress;
+ (NSString *)getBundleID;
+ (NSString *)deviceTokenString:(NSData *)data;
+ (NSString *)appName;

+ (void)makeCallWithNumber:(NSString *)phoneNumber;

+ (BOOL)isSpecificScreen;//特殊屏幕
/**
 高度适配 750 X 
 */
+ (CGFloat)heightAdaptation:(CGFloat)height;
+ (CGFloat)adaptationByScreenWidthAt375:(CGFloat)value;



+ (CGFloat)tabbarHeight;


+ (NSString*)getCurrentTime;
+ (NSTimeInterval)dateTimeDifferenceWithStartTime:(NSString *)startTime endTime:(NSString *)endTime;

#pragma mark - data cache
+ (NSString *)dataCachePath:(NSString *)name;

+ (UINavigationController *)currentNavigationController;
+ (UIViewController *)getCurrentViewController;
/**
 根控制器
 */
+ (UINavigationController *)theRootNavigationController;

#pragma mark - string
+ (CGSize)sizeWithString:(NSString *)str andFount:(UIFont *)font andMaxSize:(CGSize)size;


/**
 打开系统浏览器
 */
+ (void)openSystemBrowserWithURL:(NSString *)url;


/**
 截屏
 */
+ (UIImage *)screenCaptureFromScrollView:(UIScrollView *)view;

+ (UIWindow *)currentKeyWindow;


/**
 置灰
 */
+ (UIImage*)getGrayImage:(UIImage*)sourceImage;



+ (YearMonth *)currentYearMonth;
+ (NSArray<YearMonth *> *)MonthAtCurrent:(NSArray *)offsetArray;
+ (NSArray<YearMonth *> *)monthAtCurrentForTransactionRecord;

/**
*  遍历获取指定类型的属性,替代就有的私有属性获取
*/

+(UIView *)FindSpecifiedSubViewFromClassName:(NSString *)className inView:(UIView *)superView;

+ (void)getPushNotificationSettingBlock:(PushNotificationSetting)returnBlock;

@end


